package com.neuedu.api.collection;

import java.util.*;

/**
 * @author 金山
 * 项目：javase
 * site: https://blog.fulfill.com.cn
 * 描述  泛型
 * @data 2024/10/2816:15
 */
public class MyGeneric {


    public static void main(String[] args) {



        //1.7+  泛型的 类型推断  在编译阶段生效
        // List<String> names = new ArrayList<>();
        List<String> names = new ArrayList();

        names.add("张三");  //String
        names.add("李四");
        names.add("王五");
        names.add("赵六");

        Set<String> set = new HashSet<String>(names);

        // names.add(101);


        for (int i = 0; i < names.size(); i++) {
            String name = (String) names.get(i);
            System.out.println("name = " + name);
        }

        Map<String,? super  Comparable> map = new HashMap();

        Integer intNumber  = new Integer(100);
        map.put("0001",intNumber);
    }











}
